<html>
<head><meta charset="utf-8"><title>dylib linking breakage · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html">dylib linking breakage</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="182674053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674053">(Dec 05 2019 at 16:05)</a>:</h4>
<p>spawned off T-compiler meeting discussion</p>



<a name="182674192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674192">(Dec 05 2019 at 16:07)</a>:</h4>
<p>context: there's discussion of breakage injected by PR <a href="https://github.com/rust-lang/rust/issues/59752" target="_blank" title="https://github.com/rust-lang/rust/issues/59752">#59752</a></p>



<a name="182674201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674201">(Dec 05 2019 at 16:07)</a>:</h4>
<p>see e.g. this comment: <a href="https://github.com/rust-lang/rust/pull/59752#issuecomment-554628486" target="_blank" title="https://github.com/rust-lang/rust/pull/59752#issuecomment-554628486">https://github.com/rust-lang/rust/pull/59752#issuecomment-554628486</a></p>



<a name="182674223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674223">(Dec 05 2019 at 16:07)</a>:</h4>
<p>which links to a number of issues that provide examples of things that "broke"</p>



<a name="182674256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674256">(Dec 05 2019 at 16:07)</a>:</h4>
<p>but some (perhaps all?) of these were using unsupported use cases</p>



<a name="182674382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674382">(Dec 05 2019 at 16:08)</a>:</h4>
<p>I've self-assigned <a href="https://github.com/rust-lang/rust/issues/65610" target="_blank" title="https://github.com/rust-lang/rust/issues/65610">#65610</a> to myself for further investigation</p>



<a name="182674403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674403">(Dec 05 2019 at 16:08)</a>:</h4>
<p>it would be interesting to know if there is any public documentation that specifies what Rust dylib is?</p>



<a name="182674421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674421">(Dec 05 2019 at 16:08)</a>:</h4>
<p>I've been <em>dying</em> to research this</p>



<a name="182674451"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674451" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674451">(Dec 05 2019 at 16:09)</a>:</h4>
<p>I can feel it ... its coming ... I might have to draft yet another  <strong>epic</strong> blog post</p>



<a name="182674457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674457">(Dec 05 2019 at 16:09)</a>:</h4>
<p>as far as I know, we don't even guarantee that it is a proper shared library/DLL</p>



<a name="182674464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674464">(Dec 05 2019 at 16:09)</a>:</h4>
<p>AFAIK, we have not only no public documentation but we don't even have internal documentation (i.e., not even in our heads)</p>



<a name="182674490"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674490" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674490">(Dec 05 2019 at 16:09)</a>:</h4>
<p>/me cannot wait to interview graydon</p>



<a name="182674491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674491">(Dec 05 2019 at 16:09)</a>:</h4>
<p>Yes, I think there are lots of unknowns, but I'm not entirely comfortable with the breakage we're seeing</p>



<a name="182674512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674512">(Dec 05 2019 at 16:09)</a>:</h4>
<p>I thnk <span class="user-mention" data-user-id="116015">@Alex Crichton</span> might have "the best" picture of the history here?</p>



<a name="182674517"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674517" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674517">(Dec 05 2019 at 16:09)</a>:</h4>
<p>I guess I feel like:</p>



<a name="182674562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674562">(Dec 05 2019 at 16:10)</a>:</h4>
<p>similar to RLIBs where we reserve the right to make them MIR-only at some point</p>



<a name="182674570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674570">(Dec 05 2019 at 16:10)</a>:</h4>
<p>I'd be <em>more</em> comfortable with the breakage if we had an RFC or an announced plan</p>



<a name="182674576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674576">(Dec 05 2019 at 16:10)</a>:</h4>
<p>that we had "designed"</p>



<a name="182674608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674608">(Dec 05 2019 at 16:10)</a>:</h4>
<p>or at least that we were evolving</p>



<a name="182674617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674617">(Dec 05 2019 at 16:10)</a>:</h4>
<p>so we could point people at it</p>



<a name="182674625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674625">(Dec 05 2019 at 16:10)</a>:</h4>
<p>something other than "we'll keep the use of dylib in rustc working, by some means. The rest of you are on your own"</p>



<a name="182674661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674661">(Dec 05 2019 at 16:11)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span>'s comments on <a href="https://github.com/rust-lang/rust/issues/65610" target="_blank" title="https://github.com/rust-lang/rust/issues/65610">https://github.com/rust-lang/rust/issues/65610</a>  made it sound like a lot of crates would be affected?</p>



<a name="182674679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674679">(Dec 05 2019 at 16:11)</a>:</h4>
<p>not really sure what a lot is here</p>



<a name="182674694"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674694" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674694">(Dec 05 2019 at 16:11)</a>:</h4>
<p>and I wasn't clear if this was limited to windows-gnu?</p>



<a name="182674703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674703">(Dec 05 2019 at 16:11)</a>:</h4>
<p>well its already landed, as a stable-to-stable regression</p>



<a name="182674713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674713">(Dec 05 2019 at 16:11)</a>:</h4>
<p>ok, s/would be/are/</p>



<a name="182674719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674719">(Dec 05 2019 at 16:11)</a>:</h4>
<p>so presumably we're already seeing the fallout</p>



<a name="182674766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674766">(Dec 05 2019 at 16:12)</a>:</h4>
<p>I'm referring to this comment:</p>
<blockquote>
<p>Okay, that’s somewhat bad, then, because libraries that rely exclusively on arguments emitted by cc for linking purposes are very abound in the ecosystem.</p>
</blockquote>



<a name="182674770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674770">(Dec 05 2019 at 16:12)</a>:</h4>
<p>well, some part of the fallout anyway</p>



<a name="182674793"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674793" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674793">(Dec 05 2019 at 16:12)</a>:</h4>
<p>anyway the truth is I have no idea what the right behavior is here</p>



<a name="182674802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674802">(Dec 05 2019 at 16:12)</a>:</h4>
<p>but I bet folks like <span class="user-mention" data-user-id="239881">@Josh Triplett</span> etc might have some instincts for it</p>



<a name="182674873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alex Crichton <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674873">(Dec 05 2019 at 16:13)</a>:</h4>
<p>This sort of change falls in line with how we don't in general give a ton of control to users about symbols and such, and it may be best solved by adding a flag or something like that to disable the behavior. I think it's true though that <code>dylib</code> has generally been designed historically as "so long as rustc keeps working, anything else goes"</p>



<a name="182674874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674874">(Dec 05 2019 at 16:13)</a>:</h4>
<p>Me neither ;) I always thought <code>#[link]</code> was optional, and based on what I’ve seen in ecosystem, others did so too. The largest problem with that notion is that things mostly work most of the time and only start failing in certain scenarios when you omit it.</p>



<a name="182674901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674901">(Dec 05 2019 at 16:13)</a>:</h4>
<p>hmm. I wonder if the scope of the "parity with C" working group is solely restricted to cdylibs, or if they are interested in dylibs too</p>



<a name="182674905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674905">(Dec 05 2019 at 16:13)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> can you confirm whether this fallout is specific to windows-gnu?</p>



<a name="182674973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674973">(Dec 05 2019 at 16:14)</a>:</h4>
<p>The breakage is not windows-gnu specific.</p>



<a name="182674982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674982">(Dec 05 2019 at 16:14)</a>:</h4>
<p>does C++ have shared libraries?</p>



<a name="182674994"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182674994" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182674994">(Dec 05 2019 at 16:14)</a>:</h4>
<p>or do they all go through a C interface?</p>



<a name="182675102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182675102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182675102">(Dec 05 2019 at 16:15)</a>:</h4>
<p>/me has to run too</p>



<a name="182675166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182675166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182675166">(Dec 05 2019 at 16:16)</a>:</h4>
<blockquote>
<p>It is not windows-gnu specific.</p>
</blockquote>
<p>how does that come about, when the PR in question only changes the behavior of windows-gnu? Or is the PR description misleading me?</p>
<blockquote>
<p>This makes windows-gnu match the behavior of windows-msvc. It probably doesn't make sense to export these symbols on other platforms either.</p>
</blockquote>



<a name="182675195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182675195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182675195">(Dec 05 2019 at 16:16)</a>:</h4>
<p>I guess, reading the code, that it is, it certainly seems to make more general changes.</p>



<a name="182675206"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182675206" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182675206">(Dec 05 2019 at 16:16)</a>:</h4>
<p>It was changed to affect all platforms.</p>



<a name="182675375"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182675375" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182675375">(Dec 05 2019 at 16:18)</a>:</h4>
<p>OK I see I see</p>



<a name="182675753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182675753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182675753">(Dec 05 2019 at 16:22)</a>:</h4>
<p>We can probably count extern functions as being exported to avoid having using <code>link</code> attributes, assuming linkers allow you to specify functions which don't exist to be exported.</p>



<a name="182676212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182676212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182676212">(Dec 05 2019 at 16:27)</a>:</h4>
<p>(at least extern functions used by any methods that are not marked <code>#[inline(never)]</code> ...?)</p>



<a name="182676641"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182676641" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182676641">(Dec 05 2019 at 16:31)</a>:</h4>
<p>OK. I don't really have a strong opinion as to the proper answer here, as I said, but I kind of feel like we should try to write-up an RFC with a plan and decide that way (personally). Making arbitrary changes at this point without having had public discussion feels not great.</p>



<a name="182679300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182679300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182679300">(Dec 05 2019 at 16:55)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span> Parity with C would only apply to cdylib or staticlib.</p>



<a name="182742462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/dylib%20linking%20breakage/near/182742462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/dylib.20linking.20breakage.html#182742462">(Dec 06 2019 at 09:27)</a>:</h4>
<blockquote>
<p>OK. I don't really have a strong opinion as to the proper answer here, as I said, but I kind of feel like we should try to write-up an RFC with a plan and decide that way (personally). Making arbitrary changes at this point without having had public discussion feels not great.</p>
</blockquote>
<p>Yes, I want to second that. I'm sure there are ways to rejigger things until most of the reported problems go away but the real issue is that don't have a specification of what is and what isn't supported and there is no public documentation of the fact that nothing at all can be expected from Rust dylibs.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>